#pragma once

#define _CRT_SECURE_NO_WARNINGS

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>

#include <process.h>
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <ctype.h>
#include <string.h>

#include <algorithm>

#ifndef SAFE_DELETE
	#define SAFE_DELETE(x) if(x) delete (x); x=NULL;
#endif

#ifndef SAFE_DELETE_ARRAY
	#define SAFE_DELETE_ARRAY(x) if (x) delete[] (x); x=NULL;
#endif

#ifndef SAFE_RELEASE
	#define SAFE_RELEASE(x) if(x) x->Release(); x=NULL;
#endif

#ifndef ENGINE_PI
	#define ENGINE_PI 3.14159265358979323846
#endif

#ifndef max
	#define max(a,b)  (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
	#define min(a,b)  (((a) < (b)) ? (a) : (b))
#endif

#ifndef FLT_EPSILON
	#define FLT_EPSILON 1.192092896e-07F
#endif

#ifndef FLT_MAX
	#define FLT_MAX 3.402823466e+38F
#endif


#define DISALLOW_COPY_AND_ASSIGN(TYPENAME) \
	TYPENAME(const TYPENAME&);             \
	TYPENAME& operator=(const TYPENAME&);
